package com.kexilo.core.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.kexilo.core.common.core.domain.BaseEntity;
import com.kexilo.core.common.validation.UpdateGroup;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
/**
 * 参数配置表 kx_sys_config
 * 
 * @author Kexilo
 */
@TableName("kx_sys_config")
public class SysConfig extends BaseEntity {
    
    private static final long serialVersionUID = 1L;

    /** 参数主键 */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "参数配置ID不能为空", groups = { UpdateGroup.class })
    private Long configId;

    /** 参数名称 */
    @NotBlank(message = "参数名称不能为空")
    @Size(max = 100, message = "参数名称不能超过100个字符")
    private String configName;

    /** 参数键名 */
    @NotBlank(message = "参数键名不能为空")
    @Size(max = 100, message = "参数键名长度不能超过100个字符")
    private String configKey;

    /** 参数键值 */
    @NotBlank(message = "参数键值不能为空")
    @Size(max = 500, message = "参数键值长度不能超过500个字符")
    private String configValue;

    /** 系统内置（Y是 N否） */
    private String configType;

    /** 备注 */
    private String remark;

    public SysConfig() {

    }

    public SysConfig(String configKey) {
        this.configKey = configKey;
    }

    // Getter methods
    public Long getConfigId() {
        return configId;
    }

    public String getConfigName() {
        return configName;
    }

    public String getConfigKey() {
        return configKey;
    }

    public String getConfigValue() {
        return configValue;
    }

    public String getConfigType() {
        return configType;
    }

    public String getRemark() {
        return remark;
    }

    // Setter methods
    public void setConfigId(Long configId) {
        this.configId = configId;
    }

    public void setConfigName(String configName) {
        this.configName = configName;
    }

    public void setConfigKey(String configKey) {
        this.configKey = configKey;
    }

    public void setConfigValue(String configValue) {
        this.configValue = configValue;
    }

    public void setConfigType(String configType) {
        this.configType = configType;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        SysConfig sysConfig = (SysConfig) o;

        return configId != null ? configId.equals(sysConfig.configId) : sysConfig.configId == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (configId != null ? configId.hashCode() : 0);
        return result;
    }
}
